<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;

class ArticleInfo extends Model
{
	use HasDateTimeFormatter;
    protected $table = 'eb_article_info';
    protected $fillable = ['title', 'ftitle','content','source','img','article_id','created_at'];
    public $timestamps = false;
    public static function booted()
    {
        parent::booted();
        static::creating(function ($model){
            if(empty($model->img)){
                $model->img = '';
            }
        });
        static::updating(function ($model){
            if(empty($model->img)){
                $model->img = '';
            }
        });
    }
}
